package com.gis.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gis.entity.User;
import com.gis.mapper.UserMapper;
import com.gis.service.UserService;

@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public User findByID(Integer ID) {
        User u = userMapper.findByID(ID);
        return u;
    }
    @Override
    public List<User> findAllUser() {
        List<User> userList = userMapper.findAllUser();
        return userList;
    }
    @Override
    public User FindByUserName(String username) {
        User u = userMapper.FindByUserName(username);
        return u;
    }
    @Override
    public void Register(String username, String password) {
        userMapper.add(username, password);
        return ;
    }
    @Override
    public void UpdateUser(User user) {
        userMapper.update(user.getUsername(), user.getPassword());
        return ;
    }
    
}
